// 查询讲台选课名单
import axios from "axios";

export function querySelection(sessionId) {
    return axios({
        method: "get",
        url: "/api/teacher/selection",
        params: sessionId,
        headers: {
            Authorization: localStorage.getItem("Authorization")
        }
    }).then(response => {
        let nameList = response.data.nameList;
        for(let i = 0;i<nameList.length;i++){
            nameList[i]["key"] = i;
        }

        return {
            result: true,
            nameList:nameList,
            total:response.data.total
        }
    }).catch(error => {
        return {
            result: false,
            msg: error.response.data.msg
        }
    })
}
